﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ReAnimation.MVP.ViewInterfaces;
using System.Windows.Forms;

namespace ReAnimation.MVP.Views
{
    public class OpenFileDialogView: IOpenFileDialogView
    {
        #region IOpenFileDialogView Members

        public String Title { get; set; }
        public String Filter { get; set; }
        public String FileName { get; set; }

        public void ShowModal()
        {
            ShowOpenFileDialog();
        }
        public bool ShowOpenFileDialog()
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.Title = Title;
            openFileDialog.Filter = Filter;
            DialogResult diaglogResult = openFileDialog.ShowDialog();

            FileName = openFileDialog.FileName;

            return diaglogResult == DialogResult.OK;
        }

        #endregion

        #region IView Members

        public event EventHandler ViewClosed;

        public void Show()
        {
            ShowOpenFileDialog();
        }

        public void Hide()
        {
            
        }

        public void Close()
        {
            
        }

        public void SuspendLayout()
        {
            
        }

        public void ResumeLayout()
        {
            
        }

        #endregion
    }
}
